home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
snpd9611.zip
/
STRREPL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1996-11-24
|
1KB
|
37 lines
.I 0 3
/* +++Date last modified: 24-Nov-1996 */
/*
.D 1 1
.I 18 2
** strrepl: Replace OldStr by NewStr in string Str contained in buffer
** of size BufSiz.
.D 19 2
.I 32 14
**
** NOTE: The name of this funtion violates ANSI/ISO 9899:1990 sec. 7.1.3,
** but this violation seems preferable to either violating sec. 7.13.8
** or coming up with some hideous mixed-case or underscore infested
** naming. Also, many SNIPPETS str---() functions duplicate existing
** functions which are supported by various vendors, so the naming
** violation may be required for portability.
*/
#if defined(__cplusplus) && __cplusplus
extern "C" {
#endif
char *strrepl(char *Str, size_t BufSiz, char *OldStr, char *NewStr)
.D 33 3
.I 50 4
#if defined(__cplusplus) && __cplusplus
}
#endif
.I 81 1
/* Repeat until all occurrences replaced */
.D 82 1
.I 89 1
Start = strrepl(Start, BufLeft, argv[1], argv[2]);
.D 90 1